package My::DateTime;

use Moose;
use MooseX::NonMoose;
use DateTime::Calendar::Mayan;
extends qw( DateTime );

has 'mayan_date' => (
	is	  => 'ro',
	isa	  => 'DateTime::Calendar::Mayan',
	init_arg  => undef,
	lazy	  => 1,
	builder	  => '_build_mayan_date',
	clearer	  => '_clear_mayan_date',
	predicate => 'has_mayan_date',
);

after 'set' => sub {
	$_[0]->_clear_mayan_date;
};

sub _build_mayan_date {
	DateTime::Calendar::Mayan->from_object( object => $_[0] );
}

__PACKAGE__->meta->make_immutable;